<?php
namespace app\api\controller;

use app\common\controller\ApiBase;

class DataContentChip extends ApiBase
{

    public function getChip()
    {
        $param = $this->request->param();
        if( empty($param['position']) ){
            return json([
                'status' => 0,
                'msg' => '参数错误'
            ]);
        }
        $make = new \app\common\lib\MakeChip();
        $data = $make->run($param['position']);
        if(empty($data)){
            return json([
                'status' => 0,
                'msg' => '没有相关数据'
            ]);
        }
        return json([
            'status' => 1,
            'msg' => '请求成功',
            'data' => $data
        ]);
    }

}